package org.snail.po.bean;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import lombok.Data;
import lombok.ToString;
import lombok.extern.log4j.Log4j;
import org.snail.config.CustomDateSerializer;
import org.snail.excel.annotation.ExcelBean;
import org.snail.excel.annotation.ExcelColumn;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.Objects;

/**
 * PO相关属性值
 */
@Data
@Log4j
@ToString
@ExcelBean
public class PoAttributeDO implements Serializable {

    private Long id;
    private int isDel;
    //客户
    @ExcelColumn(name = "customer", position = 0, columnName = "客户")
    private String customer;
    //部门
    @ExcelColumn(name = "department", position = 1, columnName = "部门")
    private String department;
    //客户主体
    @ExcelColumn(name = "customerSubject", position = 2, columnName = "客户主体")
    private String customerSubject;
    //框架协议编号
    @ExcelColumn(name = "frameworkProtocolNo", position = 3, columnName = "框架协议编号")
    private String frameworkProtocolNo;
    //PR
    @ExcelColumn(name = "prNo", position = 4, columnName = "PR")
    private String prNo;
    //项目简称
    @ExcelColumn(name = "projectAbbreviation", position = 5, columnName = "项目简称")
    private String projectAbbreviation;
    //PO项目名称
    @ExcelColumn(name = "poProjectName", position = 6, columnName = "PO项目名称")
    private String poProjectName;
    //结算
    @ExcelColumn(name = "settlement", position = 7, columnName = "结算")
    private String settlement;
    //区域&报价
    @ExcelColumn(name = "regionalQuotation", position = 8, columnName = "区域&报价")
    private String regionalQuotation;
    //PO号
    @ExcelColumn(name = "poNo", position = 9, columnName = "PO号")
    private String poNo;
    //PO金额
    @ExcelColumn(name = "poAmount", position = 10, columnName = "PO金额")
    private BigDecimal poAmount;
    //项目开始时间
    @JsonSerialize(using = CustomDateSerializer.class)
    @ExcelColumn(name = "projectStartTime", position = 11, columnName = "项目开始时间")
    private Date projectStartTime;
    //项目结束时间
    @JsonSerialize(using = CustomDateSerializer.class)
    @ExcelColumn(name = "crojectClosingTime", position = 12, columnName = "项目结束时间")
    private Date crojectClosingTime;
    //团队规模
    @ExcelColumn(name = "teamSize", position = 13, columnName = "团队规模")
    private String teamSize;
    //团队结构
    @ExcelColumn(name = "teamStructure", position = 14, columnName = "团队结构")
    private String teamStructure;
    //服务地点
    @ExcelColumn(name = "serviceLocation", position = 15, columnName = "服务地点")
    private String serviceLocation;
    //文档情况
    @ExcelColumn(name = "documentStatus", position = 16, columnName = "文档情况")
    private String documentStatus;
    //电子PO下发的时间
    @JsonSerialize(using = CustomDateSerializer.class)
    @ExcelColumn(name = "electronicDocumentTime", position = 17, columnName = "电子PO下发的时间")
    private Date electronicDocumentTime;
    //采购下发时间
    @JsonSerialize(using = CustomDateSerializer.class)
    @ExcelColumn(name = "purchaseDeliveryTime", position = 18, columnName = "采购下发时间")
    private Date purchaseDeliveryTime;
    //所属BU
    @ExcelColumn(name = "belongsBU", position = 19, columnName = "所属BU")
    private String belongsBU;
    //采购
    @ExcelColumn(name = "procurement", position = 20, columnName = "采购")
    private String procurement;
    //项目经理
    @ExcelColumn(name = "projectManager", position = 21, columnName = "项目经理")
    private String projectManager;
    //PO状态
    @ExcelColumn(name = "poStatus", position = 22, columnName = "PO状态")
    private String poStatus;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        PoAttributeDO that = (PoAttributeDO) o;
        return id == that.id &&
                Objects.equals(customer, that.customer) &&
                Objects.equals(department, that.department) &&
                Objects.equals(customerSubject, that.customerSubject) &&
                Objects.equals(frameworkProtocolNo, that.frameworkProtocolNo) &&
                Objects.equals(prNo, that.prNo) &&
                Objects.equals(projectAbbreviation, that.projectAbbreviation) &&
                Objects.equals(poProjectName, that.poProjectName) &&
                Objects.equals(settlement, that.settlement) &&
                Objects.equals(regionalQuotation, that.regionalQuotation) &&
                Objects.equals(poNo, that.poNo) &&
                Objects.equals(poAmount, that.poAmount) &&
                Objects.equals(projectStartTime, that.projectStartTime) &&
                Objects.equals(crojectClosingTime, that.crojectClosingTime) &&
                Objects.equals(teamSize, that.teamSize) &&
                Objects.equals(teamStructure, that.teamStructure) &&
                Objects.equals(serviceLocation, that.serviceLocation) &&
                Objects.equals(documentStatus, that.documentStatus) &&
                Objects.equals(electronicDocumentTime, that.electronicDocumentTime) &&
                Objects.equals(purchaseDeliveryTime, that.purchaseDeliveryTime) &&
                Objects.equals(belongsBU, that.belongsBU) &&
                Objects.equals(procurement, that.procurement) &&
                Objects.equals(projectManager, that.projectManager) &&
                Objects.equals(poStatus, that.poStatus);
    }
    @Override
    public int hashCode() {
        return Objects.hash(id, customer, department, customerSubject, frameworkProtocolNo, prNo, projectAbbreviation, poProjectName, settlement, regionalQuotation, poNo, poAmount, projectStartTime, crojectClosingTime, teamSize, teamStructure, serviceLocation, documentStatus, electronicDocumentTime, purchaseDeliveryTime, belongsBU, procurement, projectManager, poStatus);
    }

}
